import { httpRequest } from '@/http/request'
import { CosAuthorization, CosParams } from '@/types/common'
/**获取临时密钥 */
export const getUploadSignature = (params: CosParams) => {
  return httpRequest({
    url: 'common/SDK',
    method: 'POST',
    data: params,
  })
}
/**获取临时签名 */
export const getSignature = (params: CosParams) => {
  return httpRequest<string>({
    url: 'common/sign',
    method: 'POST',
    data: params,
  })
}
/** 删除文件 */
export const deleteFile = (params: CosParams) => {
  return httpRequest({
    url: 'common/deleteFileCos',
    method: 'DELETE',
    data: params,
  })
}
/**
 * 获取签名完整信息 authorization
 */
export const getFullSignature = (params: CosParams) => {
  return httpRequest<CosAuthorization>({
    url: 'common/signHeader',
    method: 'POST',
    data: params,
  })
}
/**
 * 获取head 签名
 */
export const getHeadSignature = (params: CosParams) => {
  return httpRequest<string>({
    url: 'common/signHead',
    method: 'POST',
    data: params,
  })
}
